package com.fourth_groups.shopping121store.ui.category.customview;

import android.content.Context;
import android.view.View;

import com.fourth_groups.shopping121store.R;


public class GoodsDetailInfoPage implements GoodsSnapPageLayout.GoodsSnapPage{
	
	private Context context;

	private View rootView = null;
	private GoodsScrollView goodsScrollView = null;
	
	public GoodsDetailInfoPage(Context context, View rootView) {
		this.context = context;
		this.rootView = rootView;
		goodsScrollView = (GoodsScrollView) this.rootView
				.findViewById(R.id.product_scrollview);
	}

	@Override
	public View getRootView() {
		return rootView;
	}

	@Override
	public boolean isAtTop() {
		return true;
	}

	@Override
	public boolean isAtBottom() {
        int scrollY = goodsScrollView.getScrollY();
        int height = goodsScrollView.getHeight();
        int scrollViewMeasuredHeight = goodsScrollView.getChildAt(0).getMeasuredHeight();

        if ((scrollY + height) >= scrollViewMeasuredHeight) {
            return true;
        }
        return false;
	}


}
